<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=8" />

	<title>HSMP-<?php $this->_block('title'); ?><?php $this->_endblock(); ?></title>
	<meta name="description" content="A web applications user interface library built on the Mootools JavaScript framework" />

	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>themes/default/css/Content.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>themes/default/css/Core.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>themes/default/css/Layout.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>themes/default/css/Dock.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>themes/default/css/Window.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>themes/default/css/Tabs.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>js/tablecloth.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>css/redmond.datepick.css">
	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>css/blue.covertape.css">
	<script type="text/javascript" src="<?php echo $_BASE_DIR; ?>js/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="<?php echo $_BASE_DIR; ?>js/jquery.datepick.min.js"></script>
	<script type="text/javascript" src="<?php echo $_BASE_DIR; ?>js/jquery.covertape-0.3.js"></script>
	<script type="text/javascript" src="<?php echo $_BASE_DIR; ?>js/tablecloth.js"></script>
	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>css/hids_style.css">
	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>css/redmond.datepick.css">
	<link rel="stylesheet" type="text/css" href="<?php echo $_BASE_DIR; ?>css/blue.covertape.css">
	<script type="text/javascript">
		
		var textOptions = new Array( "action", "","","", "","", "process", "PID","进程ID", "fileinfo", "","", "reginfo1", "","", "tcpconns", "originalip|originalport|targetip|targetport|filename|state", "客户端IP|客户端端口|目标IP|目标端口|文件名|状态", "cmdinfo", "","", "terminallog", "loginIP|loginname|loginuser|loginmac", "登录IP|登录名|用户名|登录MAC地址", "reginfo", "","");
			var textinput = new Object();
			var textname = new Object();
			for(var i = 0; i < textOptions.length/3; i++) 
			{   
				textinput[textOptions[i*3]] = textOptions[i*3+1];
				textname[textOptions[i*3]] = textOptions[i*3+2];
			}
		
		jQuery(document).ready(function(){
		  jQuery("#xia").datecontrol({format:"yyyy-mm-dd"});
		  var sd=$("#startd").val();
		  var ed=$("#endd").val();

		  jQuery('#infotype').change(function(){
			  golist(jQuery(this).val());
		  });
		  

		  var nowlistr="<?php $this->_block('orderstr'); ?><?php $this->_endblock(); ?>";
			
		  //alert(sd);
		  var nd=showDate();
		  //alert(nd+ed+sd);
		  if(sd=='' && ed==''){
			//alert('212332');
		  }else{
			//alert('1233');
			jQuery("input[name=startdate]").html(sd);
			jQuery("input[name=startdate]").val(sd);
			jQuery("input[name=enddate]").html(ed);
			jQuery("input[name=enddate]").val(ed);
			var k1 = sd.split(' ');
			var k2 = ed.split(' ');
			//alert(k1.length);
			if(k1.length>1)sd=k1[0];
			if(k2.length>1)ed=k2[0];
			jQuery(".view_date").html(sd+' - '+ed);
		  }

			var nowt="<?php $this->_block('vars'); ?><?php $this->_endblock(); ?>";
			var k1 = textinput[nowt].split('|');
			var k2 = textname[nowt].split('|');
			//alert(k1.length);
			jQuery("#ordercol").empty();
			jQuery("#auto_table").hide();
			jQuery("<option selected=\"selected\" value=\"\">默认</option>").appendTo("#ordercol");
			if(k1.length>0){
				
				jQuery('#auto_table tr').html('');
				for(var j = 0; j < k1.length; j++) 
				{   
					if(k1[j]!=''){
						jQuery("#auto_table").show();
						//alert(k2[j]);
						//jQuery('#auto').append('<label for="'+k1[j]+'">'+k2[j]+'</label><input id="'+k1[j]+'" name="'+k1[j]+'" value="" type="text"></p><p>');
						//auto_tr
						jQuery('#auto_table tr').append('<td><label for="'+k1[j]+'">'+k2[j]+'</label><input id="'+k1[j]+'" name="'+k1[j]+'" value="" type="text"></td>');
						jQuery("<option value='"+k1[j]+"'>"+k2[j]+"</option>").appendTo("#ordercol");
						//textinput[textOptions[i*2]] = textOptions[i*2+1];
					}else{
						//alert(k1.length);
					}
				}
			}
			//alert(nowlistr);
			jQuery("#ordercol").val(nowlistr);
			//其他
		    jQuery("input[name=PID]").val("<?php $this->_block('PID'); ?><?php $this->_endblock(); ?>");
			jQuery("input[name=originalip]").val("<?php $this->_block('originalip'); ?><?php $this->_endblock(); ?>");
			jQuery("input[name=originalport]").val("<?php $this->_block('originalport'); ?><?php $this->_endblock(); ?>");
			jQuery("input[name=targetip]").val("<?php $this->_block('targetip'); ?><?php $this->_endblock(); ?>");
			jQuery("input[name=targetport]").val("<?php $this->_block('targetport'); ?><?php $this->_endblock(); ?>");
			jQuery("input[name=filename]").val("<?php $this->_block('filename'); ?><?php $this->_endblock(); ?>");
			jQuery("input[name=state]").val("<?php $this->_block('state'); ?><?php $this->_endblock(); ?>");
			jQuery("input[name=loginIP]").val("<?php $this->_block('loginIP'); ?><?php $this->_endblock(); ?>");
			jQuery("input[name=loginname]").val("<?php $this->_block('loginname'); ?><?php $this->_endblock(); ?>");
			jQuery("input[name=loginuser]").val("<?php $this->_block('loginuser'); ?><?php $this->_endblock(); ?>");
			jQuery("input[name=loginmac]").val("<?php $this->_block('loginmac'); ?><?php $this->_endblock(); ?>");
			//alert(textinput['tcpconns']);
		});

		function golist(a){
			var k1 = textinput[a].split('|');
			var k2 = textname[a].split('|');
			//alert(k1);
			jQuery("#ordercol").empty();
			jQuery("#auto_table").hide();
			jQuery("<option selected=\"selected\" value=\"\">默认</option>").appendTo("#ordercol");
			if(k1.length>0){
				
				//jQuery("#auto_table").show();
				//jQuery('#auto').html('');
				jQuery('#auto_table tr').html('');
					for(var j = 0; j < k1.length; j++) 
					{   
						if(k1[j]!=''){
							jQuery("#auto_table").show();
							//alert(k2[j]);
							//jQuery('#auto').append('<label for="'+k1[j]+'">'+k2[j]+'</label><input id="'+k1[j]+'" name="'+k1[j]+'" value="" type="text"></p><p>');
							jQuery('#auto_table tr').append('<td><label for="'+k1[j]+'">'+k2[j]+'</label><input id="'+k1[j]+'" name="'+k1[j]+'" value="" type="text"></td>');
							jQuery("<option value='"+k1[j]+"'>"+k2[j]+"</option>").appendTo("#ordercol");
							//textinput[textOptions[i*2]] = textOptions[i*2+1];
						}else{
							//alert(k1.length);
						}
					}
				}
		}

		function showDate()   
		{   
			var today = new Date();   
			var day = today.getDate();   
			var month = padLeft(today.getMonth() + 1,2);   
			var year = today.getFullYear();   
			var date = year + "-" + month + "-" + day;   
			return date;   
		}

		function padLeft(str,lenght){   
		  if(str.length >= lenght)   
		   return str;   
		  else  
		   return padLeft("0" +str,lenght);   
		} 

	</script>
</head>
<body>

</head>
<body style="margin:10px;">

<?php $this->_block('contents'); ?><?php $this->_endblock(); ?>

</body>
</html>